home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / util / libs / MMULib.lha / MMULib / ReadMe < prev    next >
Encoding:
Text File  |  1998-10-04  |  17.5 KB  |  439 lines

  1. The mmu.library project © 1998 the mmu.library development group, THOR
  2. -----------------------------------------------------------------------------
  3.  
  4. Release 0.05
  5. ------------
  6.  
  7.     -Fixed a bug in the context management, memory property setup
  8.      routine. Due to a typo, one register was assigned in the wrong
  9.      way and messed up the routine. Just the joy of assembly! Sigh.
  10.      "NUTS" seems to work flawlessy, though.
  11.      Thanks to all the testers, locating and fixing this bug was
  12.      just a matter of ten minutes.
  13.  
  14. Release 0.04
  15. ------------
  16.  
  17. Bugs fixed:
  18.  
  19.     -Rewrote the MMU table parser completely. The old one was simply too
  20.     broken to fix it. The "New Universal Table Scanner" - or short 
  21.     "NUTS" (-; contains very little hardware dependent code, so I was 
  22.     able to check most of it without having a '040 or '060 MMU available.
  23.     Should hopefully work now. It took one day to debug all that, all
  24.     the special cases... It's really a recursive monster algorithm,
  25.     hope the comments are somewhat useable.
  26.     -Added a check for the EC040. Thanks for the insight, Simon! At
  27.     that time, no check for a EC030 vs. a real 030 is available. The
  28.     motorola specs say I've to build a MMU page and check what happens...
  29.     Something like this might be implemented in a future version, as
  30.     soon as the table scanner and the table builder are working.
  31.     -Added an explicit version check for MMUScan.
  32.     -Added a memory flush in MMScan. "Avail Flush" is no longer
  33.     required.
  34.     -Added the "TestMMU" program for debugging purposes. More on that
  35.     below.
  36.  
  37. Release 0.02
  38. ------------
  39.  
  40. Bugs fixed:
  41.  
  42.     -Due to a typo in the 68040/68060 startup code, the translation
  43.     control register wasn't written to the right place, leading mis-
  44.     interpretations of the library.
  45.     -The 68040 specific part did not call the 68040 table scanner, but
  46.     the 68060 stuff.
  47.     -The library clean up code did not fill in the translation control
  48.     register correctly for the 68040 and 68060.
  49.     -The library did not accept "exotic" transparent translation
  50.     settings. Unfortunately, these are not as uncommon as I believed.
  51.     Some boards seem to translate a part of the memory transparently
  52.     for read access only. I've no idea what this might be good for.
  53.     But anyways, the memory regions transparently translated are now
  54.     "mapped out" by the mmu.library and marked as unusable for
  55.     further manipulation. This means specifically that a huge part of
  56.     the available address space may be unavailable for virtual addresses.
  57.     A future version of the libray may re-introduce the integration of
  58.     the TTx registers into the mmu table, but up to then I don't like
  59.     to risk anything.
  60.  
  61. What is this:
  62. -------------
  63.     The mmu.library provides functions for MMU related operations
  64.     as write- or read-protecting certain areas of memory for a
  65.     given set of tasks, or marking memory regions as "swapped"
  66.     virtual memory support. It offers an abstraction level on top
  67.     of the actual MMU and a unified interface for MMU purposes.
  68.  
  69.     The MMU lib does NOT implement virtual memory, that's the purpose
  70.     of another library - the memory.library. There's no much reason why
  71.     any application except the memory.library and probably some debugging
  72.     tools should call this library directly. The memory.library functions
  73.     on top of this library should suffer for "all day purposes".
  74.  
  75.     The goal of the mmu.library is to provide an "abstraction layer" on
  76.     top of the hardware, to allow programs to make use of the memory
  77.     management hardware of the more advanced members of the MC68K
  78.     processor family. Programs using the functions of the mmu.library
  79.     do not need to modify the MMU tables directly and hence will not
  80.     conflict with each other. The mmu.library interface provides all
  81.     necessary functions to do that. This will allow programs like
  82.     Enforcer and VMM to cooperate nicely with each other, provided both
  83.     use this library.
  84.  
  85. Since writing the mmu.library is a tough job, I need your help! I've only
  86. a single oldish MC68030 40Mhz system at home, but the mmu.library is 
  87. supposed to support all members of the MC68K family (the 68851, 68040 and
  88. 68060 MMUs). Since I don't have a testing system available, I need your
  89. help - writing system software without being able to debug is "a bit" 
  90. tricky.
  91.  
  92. What can I do as a non-developer:
  93. ---------------------------------
  94.  
  95. Simple. Stop all disk access, upack the archive to the RAM disk, then open a
  96. shell and enter
  97.  
  98. assign LIBS: ram: add
  99.  
  100. then run the "MMUScan" program. Watch what happens: The program should output
  101. a list like the following:
  102.  
  103. MMUScan 0.05 (04.10.98) © THOR.
  104. Internal use only, no commercial use.
  105. 68030 MMU detected.
  106. MMU page size is 0x400 bytes.
  107. User root pointer: 0x800000020023f870
  108. Supervisor root pointer: 0x0000000000000000
  109. Translation Control           : 0x80a08680
  110. Data Transparent translation 0: 0xffff0777
  111. Data Transparent translation 1: 0xffff0777
  112. Inst Transparent translation 0: 0x00000000
  113. Inst Transparent translation 1: 0x00000000
  114. Memory region: 00000000 to 000003ff invalid, ID 00000000 global 
  115. Memory region: 00000400 to 001fffff cache inhibited global 
  116. Memory region: 00200000 to 009fffff copyback cache mode global 
  117. Memory region: 00a00000 to 00bbffff invalid, ID 00000000 global 
  118. Memory region: 00bc0000 to 00bfffff cache inhibited global 
  119. Memory region: 00c00000 to 00d7ffff invalid, ID 00000000 global 
  120. Memory region: 00d80000 to 00dfffff cache inhibited global 
  121. Memory region: 00e00000 to 00e7ffff invalid, ID 00000000 global 
  122. Memory region: 00e80000 to 00ebffff cache inhibited global 
  123. Memory region: 00ec0000 to 00efffff invalid, ID 00000000 global 
  124. Memory region: 00f00000 to 00ffffff write protected copyback cache mode global 
  125. Memory region: 01000000 to ffffffff invalid, ID 00000000 global 
  126.  
  127. This is the definition of your MMU profile, giving the properties of each
  128. page in memory.
  129.  
  130. Watch out for possible crashes or other problems. If anything goes wrong,
  131. please write down the guru number and contact me. The email is above.
  132.  
  133.  
  134. If you see a guru - shouldn't happen any more - then please run the 
  135. PrintTTX program in this directory instead and send me the output.
  136.  
  137.  
  138. What can I do as developer:
  139. ---------------------------
  140.  
  141. What about joining the mmu.library development group? This is just a couple
  142. of people contributing to this library by writing code and exchanging their
  143. wisdom by EMail. It's a non-profit organization that works on the development
  144. of this library. If, whenever, this library becomes a commercial product, 
  145. you'll get paid, of course. However, the current library, as it is, is planned
  146. to be freeware, so don't expect money. It doesn't look like there's currently
  147. a market for this library project, unfortunately. 
  148.  
  149. Contact me at thor@math.tu-berlin.de if you want to join this group.
  150.  
  151.  
  152. What can be done just now is to run this library on your machine and find
  153. and correct bugs. As I said, I haven't tested the 68851, the 68040 and 68060
  154. parts at all. The source of the library is included to help you debugging it,
  155. but please don't make modifications without contacting me.
  156.  
  157.  
  158. What is required to build the library:
  159. --------------------------------------
  160.  
  161. The library is build by two assemblers, the DevPac and the Freeware assembler
  162. PhxAss which can be found on the AmiNet. I still prefer the DevPac because
  163. it's Macro capabilities, even though it doesn't support all the 68060 
  164. functions I need to get hands on. Hence, the general-purpose functions of
  165. the library are assembled with DevPac - the .asm files - , the processor 
  166. specific routines - in the .a files - use the PhxAss, however.
  167.  
  168. A make utitilty would do good, the makefile is included. 
  169. "Make debug" will build the binary. Two assigns need to be setup, MMU: and
  170. TMP:.
  171.  
  172. The sources should be copied to TMP: on installation, the makefile will
  173. make backups to MMU: automatically.
  174.  
  175. A linker is required to link the object codes toghether. The makefile uses
  176. the "SLink" linker of the SAS C package, but the "BLink" PD linker of the
  177. "Software Destillery" should work fine, too. It is available from the
  178. Aminet, for example. Just edit the makefile and replace "SLink" with "BLink". 
  179.  
  180. A C compiler is needed to compile the example program "MMUScan". Every C
  181. compiler should do fine provided the contents of "Include" is copied to the
  182. include directory of your compiler installation, or this directory is added
  183. to the include search path.
  184.  
  185.  
  186. What is in this distribution:
  187. -----------------------------
  188.  
  189. Autodocs:
  190.     The preliminary version of the autodocs of the mmu.library and
  191.     the memory library, as well as a file describing some planned
  192.     implementation details.
  193.  
  194. Include:
  195.     The includes for a C compiler as well as the ".fd" file for the
  196.     library functions written so far. In detail:
  197.  
  198.     mmu/mmubase.h    The library base as well as the defines describing
  199.             the MMU types found.
  200.  
  201.     mmu/context.h    Describing the main structure of the mmu.library,
  202.             the context. This defines, too, the memory
  203.             properties that can be set by the MMU, as
  204.             non-cacheable or write protected.
  205.  
  206.     mmu/config.h    Describes an internal-use-only MMU configuration
  207.             structure. A final edition of this library won't
  208.             include this file.
  209.  
  210.     mmu/alerts.h    Defines the guru-mediations that can be thrown by
  211.             the library.
  212.  
  213.     mmu_lib.fd    The function descriptor file written so far.
  214.  
  215.     clib        Prototypes for the library functions.
  216.  
  217.     pragmas        Pragmas for the library functions. Created with
  218.             FDToPragma. Should work with every compiler.
  219.  
  220.     proto        Prototypes for the library, includes the clib and
  221.             the pragma file.
  222.  
  223. C_Sources:
  224.     C sources of sample programs. That's currently only the MMUScan
  225.     program that prints the MMU configuration, the page size, the
  226.     type of the MMU found and its hardware configuration.
  227.  
  228. MMUScan:
  229.     The ready-for-use MMUScan program. Quite long because I compiled
  230.     this with the standard link-library I/O functions. Could be done
  231.     much better, but this is only a test program anyways.
  232.  
  233. TestMMU:
  234.     This program is purely for debugging purposes. If you run it,
  235.     you won't see any specific action. It simply opens the library
  236.     manually and executes the library init function in the task
  237.     context of the calling program. Hence, this program can be used
  238.     to step thru the lib-init function with a standard debugger
  239.     without the need to catch "ramlib".
  240.     The "NUTS" table scanner is part of the library init function
  241.     and the most critical part. 
  242.     If you still discover bugs and want to try, then load this
  243.     program into a debugger of your choice, and step thru it.
  244.  
  245. Lib_Sources:
  246.     The library sources. This is more or less a direct copy from my
  247.     harddisk. Includes the assembly sources, the assembly headers
  248.     used to assemble this, the Makefile and the object files if you
  249.     don't want to re-assemble everything. Contains, too, some startup-
  250.     files used for my assembler setup. Not necessarely required.
  251.     Needless to say that everything in here is "private" in the sense
  252.     that no program using the mmu.library should depend on the
  253.     implenentation details defined by these files.
  254.     The ".a" files are assembled by PhxAss, ".asm" is done by "DevPac"
  255.     and ".i" are the includes.
  256.  
  257.     In detail:
  258.  
  259.     Project-Startup:    Makes necessary assignments and copies
  260.                 the sources into a temporary directory.
  261.                 Run at my system as soon as I launch the
  262.                 assembler.
  263.  
  264.     Shell-Startup2:        A shell script run by the "Project-Startup"
  265.                 that makes a few additional setups.
  266.  
  267.     Makefile:        The makefile used to assemble and link this
  268.                 program.
  269.  
  270.     mu_version.i:        Defines the version of this library.
  271.     mu_lib.i:        The detailed library header structure.
  272.     mu_lib.asm:        The library initialization and shutdown 
  273.                 code, the resident structure of the library
  274.                 and some few stub funtions.
  275.     mu_alerts.i:        Defines the gurus thrown by the library.
  276.     mu_detect.a:        The MMU auto detection logic. Should work
  277.                 fine (better than the enforcer code which
  278.                 crashes on a plain MC68020 without MMU...)
  279.     mu_service.asm:        Service routines. Currently, a routine to
  280.                 allocate library aligned to page boundaries.
  281.                 Not yet used, but still there.
  282.     mu_pool.asm:        Memory pool functions. Since the exec 
  283.                 functions are bugged unless SetPatch is
  284.                 installed, I prefer using my own.
  285.     mu_context.i:        Describes the MMU library main structure, the
  286.                 (MMU)-Context, as well as the MMU memory
  287.                 property flags and the map node structure used
  288.                 for the abstraction level of the MMU tables.
  289.     mu_context.asm:        Context management and manipulation functions,
  290.                 including a function that builds the default
  291.                 MMU mapping if no MMU table was found.
  292.     mu_loadlib.asm:        This is not linked to the library. It's a
  293.                 tiny assembly source that loads the library
  294.                 to allow a standard debugger to step thru.
  295.     mu_tableparse.asm:    The "NUTS" table scanning algorithm, used to
  296.                 build the MMU table abstraction from the
  297.                 hardware MMU table. Is even able to scan
  298.                 "long" descriptors with limits of a '030
  299.                 system (that, at least, I tested). Should
  300.                 also handle the '040 and '060 MMU tables.
  301.                 If "MMUScan" still hangs, HERE's the bug.
  302.     mu_descriptor.i:    Another abstraction layer used by "NUTS"
  303.                 to describe a hardware table descriptor.
  304.     mu_851.a:        68851 specific routines, load and save the
  305.                 MMU configuration, interprets hardware MMU
  306.                 table descriptors and converts them into
  307.                 a hardware-independent format for "NUTS".
  308.     mu_030.a:        68030 specific routines.
  309.     mu_040.a:        68040 specific routines.
  310.     mu_060.a:        68060 specific routines.
  311.     
  312. Asm_Includes:
  313.     I'm usually too lazy to include the system header files when writing
  314.     in assembly. It usually takes ages to include them... These includes
  315.     just define the library offsets of some standard libraries without
  316.     the anoying "_LVO" I can't stand (what is this supposed to do 
  317.     anways?).
  318.     It also defines a set of sophisticated macros for the DevPac assembler
  319.     (Macros.asm). An older version of these can be found on my web page.
  320.  
  321.     Unfortunately, the PhxAss Assembler isn't powerful enough to assemble
  322.     these. (Sigh.)
  323.  
  324.  
  325. Known bugs and problems of this implementation:
  326. -----------------------------------------------
  327.  
  328. Things that require testing:
  329.  
  330.     - 68851, 68040 and 68060 code completely untested. I NEED YOUR HELP!
  331.       However, looks like this works, after checking your outputs.
  332.     - Parsing of the transparent translation registers untested.
  333.        Seems to be working, at least for the 68030 TTR registers.
  334.     - Parsing of setups which make use of a distinct user/supervisor
  335.       MMU table. 
  336.  
  337. Things not yet implemented:
  338.  
  339.     - Building and modification of MMU tables.
  340.     - The exception handler (tricky!)
  341.     - The context switch routines.
  342.     - An interface to the 68060 library required to adapt changes of
  343.       this library into the mmu.library page tables.
  344.  
  345. Things the current design does not allow:
  346.  
  347.     - MMU tables using the function codes. The amiga design shouldn't
  348.       allow this anyways, but I don't know whether there's a board
  349.       that makes use of them. (Does'nt look like, though).
  350.     - Boards with two different MMU's on board. I've heard some
  351.       rumours that there are actually 68040 boards with an additional
  352.       68851. The current library assumes a 68040 MMU.
  353.     - The current implementation does not yet check completely whether
  354.       an "EC" type processor (without an MMU) is on-board. This check
  355.       should work for the 68060 since there's a hardware register for
  356.       it, and there's now even a test for a EC040 which hopefully
  357.       works, but there's NO test for the EC030 because I wasn't able
  358.       to find a simple one. More might follow as soon as the table
  359.       scanner and the table builder is up.
  360.  
  361. I would really enjoy if someone (Ralph Schmidt?) could give me some internal
  362. information about the P5 boards and their MMU usage. Especially, the function
  363. calls and the design of the 68040 and 68060 library would be of great help,
  364. as well as some specifics of the DMA problems of the Enforcer and the
  365. various versions of the 68060 library (Michael Sinsz should know this?).
  366.  
  367. Any kind of information will be appreciated!
  368.  
  369.  
  370. Debugging:
  371. ----------
  372.  
  373. Yes, that's a problem of its own. Obviously, the MMU library uses some
  374. "heavy magic" supervisor code which is not available for a standard monitor.
  375. Even though the DevPac "MonAm" is a nice and powerful debugger, it's not
  376. powerful enough for these tricks. There's currently - up to my knowledge -
  377. only one debugger that can do this for you, and that's my own... (-;
  378.  
  379. Check the Aminet and my web-page for COP, then read the documentation. If,
  380. after reading, you STILL want to use it, you're the right guy for this
  381. job... (-;
  382. COP might be setup to load the symbols of the library, to help you a bit.
  383. A printout of the critical part - NUTS to be specific - might be helpful,
  384. too.
  385.  
  386.  
  387. Recommended reading:
  388. --------------------
  389.  
  390. The following books are recommended reading:
  391.  
  392.  
  393. Motorola 68030 Enhanced 32-bit Microprocessor User's Manual    
  394.     MC68030UM/AD Rev.3
  395.  
  396. Motorola 68040 User's Manual                    
  397.     M68040UM/AD Rev.1
  398.  
  399. Motorola 68060 User's Manual                    
  400.     M68060UM/AD Rev.1
  401.  
  402. Motorola M68000 Family Programmer's Reference Manual        
  403.     M68000PM/AD Rev.1
  404.  
  405. Amiga Hardware Reference Manual, 3rd ed.
  406.     Addison-Wesley Publishing Company, Inc.
  407.     ISBN 0-201-56776-8
  408.  
  409. Amiga ROM Kernal Reference Manual, 3rd ed., Volume "Libraries"
  410.     Addison-Wesley Publising Company, Inc.
  411.     ISBN 0-201-56774-1
  412.  
  413. The Amiga Guru Book, 2nd Ed.
  414.     Ralph Babel, Taunusstein 1989,1993
  415.  
  416. Additional sources:
  417.     The Amiga Developer CD V1.1 
  418.     (newer versions are already available, but 1.1 is good enough).
  419.  
  420.  
  421. Final words:
  422. ------------
  423.  
  424. The mmu.library and the memory library will be my last project for the Amiga. 
  425. It depends a bit on what happens with the Amiga in the next two years whether 
  426. a PPC version of this library is required or not; hence, after all, this
  427. can't be much more than a toy project that came several years too late.
  428.  
  429. However, as it looks now, Amiga goes PC. I'm currently not willing to 
  430. support this step and the Intel/Microsoft illnesses.
  431.  
  432. \begin{sarcastic}
  433. While Commodore just dug the grave for the Amiga, Gateway is turning it into
  434. a zombie.
  435. \end{sarcastic}
  436.  
  437. So long,
  438.     Thomas
  439.